package com.sanqi.work.manager.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.sanqi.work.domain.WorkStepLevelPrice;
import com.sanqi.work.manager.IWorkStepLevelPriceManager;
import com.sanqi.work.mapper.WorkStepLevelPriceMapper;
@Component
public class WorkStepLevelPriceManager implements IWorkStepLevelPriceManager {
    @Autowired
    private WorkStepLevelPriceMapper workStepLevelPriceMapper;

    @Override
    public int removeByLevelId(String levelId) {
        LambdaQueryWrapper<WorkStepLevelPrice> query = new LambdaQueryWrapper<>();
        query.eq(WorkStepLevelPrice::getLevelId, levelId);
        return this.workStepLevelPriceMapper.delete(query);
    }

    @Override
    public List<WorkStepLevelPrice> queryByLevelId(String levelId) {
        LambdaQueryWrapper<WorkStepLevelPrice> query = new LambdaQueryWrapper<>();
        query.eq(WorkStepLevelPrice::getLevelId, levelId);
        return workStepLevelPriceMapper.selectList(query);
    }

    @Override
    public List<WorkStepLevelPrice> queryByLevelIds(List<String> levelIds) {
        LambdaQueryWrapper<WorkStepLevelPrice> query = new LambdaQueryWrapper<>();
        query.in(WorkStepLevelPrice::getLevelId, levelIds);
        return workStepLevelPriceMapper.selectList(query);
    }
}
